package com.ruoyi.web.controller.zsix;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.process.AssigneeUserEntity;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.zsix.service.IAssigneeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/as")
public class TaskAssigneeController extends BaseController {
    @Autowired
    private IAssigneeUserService assigneeUserService;
    /**
     * 获取用户任务中设置的规则数据
     * @param assigneeUserEntity
     * @return
     */
    @Log(title = "获取用户任务中设置的规则数据" , businessType = BusinessType.EXPORT)
    @PostMapping("/getAssigneeUserWithTaskId")
    public AjaxResult getAssigneeUserWithTaskId(@RequestBody AssigneeUserEntity assigneeUserEntity){
        return success(assigneeUserService.getAssigneeUserWithTaskKey(assigneeUserEntity));
    }

    /**
     * 设置用户任务中设置的规则数据
     * @param param
     * @return
     */
    @Log(title = "设置用户任务中设置的规则数据" , businessType = BusinessType.EXPORT)
    @PostMapping("/setAssigneeUser")
    public AjaxResult setAssigneeUser(@RequestBody JSONObject param){
        return success(assigneeUserService.setAssigneeUser(param));
    }

    /**
     * 移除节点处理人
     * @param
     * @return
     */
    @Log(title = "移除节点处理人" , businessType = BusinessType.EXPORT)
    @PostMapping("/deleteAssigneeUser")
    public AjaxResult deleteAssigneeUser(@RequestBody AssigneeUserEntity assigneeUserEntity){
        return success(assigneeUserService.deleteAssigneeUser(assigneeUserEntity));
    }
}
